-
-
Notifications
You must be signed in to change notification settings - Fork 265
feat: Glossaries #3003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: glossaries
Are you sure you want to change the base?
feat: Glossaries #3003
Conversation
b6ac50b
to
1bfd767
Compare
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces a comprehensive glossary management feature across the backend, frontend, and end-to-end testing layers. It adds new database tables, backend entities, repositories, services, and API endpoints for managing glossaries, terms, and translations. The frontend implements glossary UI components, routes, hooks, and validation schemas, with integrated permissions and feature gating. Extensive end-to-end Cypress tests are included to validate glossary creation, editing, deletion, navigation, and permissions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant API
participant DB
User->>WebApp: Navigates to Organization Glossaries
WebApp->>API: GET /v2/organizations/{orgId}/glossaries
API->>DB: Query glossaries for organization
DB-->>API: Glossary list
API-->>WebApp: Glossary list
WebApp->>User: Displays glossary list
User->>WebApp: Creates/Edits Glossary
WebApp->>API: POST/PUT /v2/organizations/{orgId}/glossaries
API->>DB: Insert/Update glossary
DB-->>API: Success
API-->>WebApp: Created/Updated glossary
WebApp->>User: Shows confirmation
User->>WebApp: Views Glossary Terms
WebApp->>API: GET /v2/organizations/{orgId}/glossaries/{glossaryId}/terms
API->>DB: Query glossary terms
DB-->>API: Term list
API-->>WebApp: Term list
WebApp->>User: Displays term list
User->>WebApp: Adds/Edits Term
WebApp->>API: POST/PUT /v2/organizations/{orgId}/glossaries/{glossaryId}/terms
API->>DB: Insert/Update term (+ translation)
DB-->>API: Success
API-->>WebApp: Created/Updated term
WebApp->>User: Shows confirmation
User->>WebApp: Edits Term Translation
WebApp->>API: POST /v2/organizations/{orgId}/glossaries/{glossaryId}/terms/{termId}/translations
API->>DB: Insert/Update translation
DB-->>API: Success
API-->>WebApp: Updated translation
WebApp->>User: Shows updated translation
User->>WebApp: Uses translation tools
WebApp->>API: GET /v2/projects/{projectId}/glossary-highlights?text=...&languageTag=...
API->>DB: Find matching glossary terms
DB-->>API: Highlights
API-->>WebApp: Highlights
WebApp->>User: Renders highlights in translation visual
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
e4846cf
to
81aa318
Compare
33d4b96
to
19c8f9e
Compare
7eb3a67
to
0487aaa
Compare
0487aaa
to
8ee8c4f
Compare
b58d617
to
872dda5
Compare
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! 👍
Thanks a lot!
@@ -72,6 +72,11 @@ class ActivityRevision : java.io.Serializable { | |||
*/ | |||
var projectId: Long? = null | |||
|
|||
// /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out, todo
var name: String = "", | ||
@ActivityLoggedProp | ||
@Column(nullable = false) | ||
var baseLanguageTag: String? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index on the tag?
var terms: MutableList<GlossaryTerm> = mutableListOf() | ||
|
||
@ManyToOne(optional = true, fetch = FetchType.LAZY) | ||
lateinit var organizationOwner: Organization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index on organization?
var description: String? = null, | ||
) : StandardAuditModel() { | ||
@ManyToOne | ||
lateinit var glossary: Glossary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index?
var text: String? = null, | ||
) : StandardAuditModel() { | ||
@ManyToOne | ||
lateinit var term: GlossaryTerm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index?
|
||
import io.tolgee.ee.api.v2.hateoas.model.glossary.GlossaryTermModel | ||
|
||
data class GlossaryTermHighlightDto( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create model and model assembler instead.
@Schema(example = "cs-CZ", description = "Language tag according to BCP 47 definition") | ||
@field:NotBlank | ||
@field:Size(max = 20) | ||
@field:Pattern(regexp = "^[^,]*$", message = "can not contain coma") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment about tag.
@field:Size(max = 500) | ||
var description: String? = null | ||
|
||
var flagNonTranslatable: Boolean? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the props.
gtt.term.glossary.deletedAt is null | ||
""", | ||
) | ||
fun findByFirstWordLowercasedAndLanguageTagAndAssignedProjectIdAndOrganizationId( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you provide the query, You don't have to use such a long method name :D
} | ||
|
||
@Transactional | ||
override fun glossaryTermsFor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be named getGlossaryTerms
Implements #2969 and #1418
Requires https://github.com/tolgee/translator/pull/32 to be deployed.
Expects these links to be valid documentation links:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Chores